home *** CD-ROM | disk | FTP | other *** search
/ Erotic Games: Memory / Erotic Games: Memory.iso / mac / air_installers / AdobeAIR.exe / setup.swf / scripts / components / InstallerApplication.as next >
Text File  |  2009-02-12  |  5KB  |  130 lines

  1. package components
  2. {
  3.    import flash.desktop.NativeApplication;
  4.    import flash.system.Capabilities;
  5.    import mx.core.Application;
  6.    import mx.events.PropertyChangeEvent;
  7.    import mx.styles.CSSStyleDeclaration;
  8.    import mx.styles.StyleManager;
  9.    
  10.    public class InstallerApplication extends Application
  11.    {
  12.        
  13.       
  14.       protected var _431873101locManager:LocalizationManager;
  15.       
  16.       public function InstallerApplication()
  17.       {
  18.          this._431873101locManager = LocalizationManager.getInstance();
  19.          super();
  20.       }
  21.       
  22.       private function applyToDeclaration(param1:CSSStyleDeclaration, param2:String, param3:Array) : void
  23.       {
  24.          var _loc4_:String = null;
  25.          var _loc5_:Array = null;
  26.          var _loc6_:String = null;
  27.          var _loc7_:String = null;
  28.          if(!param1)
  29.          {
  30.             return;
  31.          }
  32.          for each(_loc6_ in param3)
  33.          {
  34.             _loc4_ = null;
  35.             if(_loc6_ == "fontFamily" && Capabilities.os.indexOf("Mac") >= 0)
  36.             {
  37.                _loc7_ = this.locManager.localeChain[0];
  38.                switch(_loc7_)
  39.                {
  40.                   case "ja":
  41.                   case "ko":
  42.                   case "zh_Hans":
  43.                   case "zh_Hant":
  44.                      _loc4_ = this.locManager.getString(param2 + "fontFamilyMac","CSS",null,false);
  45.                }
  46.             }
  47.             if(_loc4_ == null)
  48.             {
  49.                _loc4_ = this.locManager.getString(param2 + _loc6_,"CSS",null,false);
  50.             }
  51.             if(_loc4_)
  52.             {
  53.                if((_loc4_ = _loc4_.replace(/"/gi,"")).match(/,/))
  54.                {
  55.                   _loc4_ = _loc4_.replace(/\s*,\s*/gi,",");
  56.                   param1.setStyle(_loc6_,_loc4_.split(","));
  57.                }
  58.                else if(_loc6_.indexOf("padding") >= 0)
  59.                {
  60.                   param1.setStyle(_loc6_,int(_loc4_));
  61.                }
  62.                else
  63.                {
  64.                   param1.setStyle(_loc6_,_loc4_);
  65.                }
  66.             }
  67.          }
  68.       }
  69.       
  70.       public function activate() : void
  71.       {
  72.          stage.nativeWindow.activate();
  73.          NativeApplication.nativeApplication.activate();
  74.       }
  75.       
  76.       public function get stageHeight() : Number
  77.       {
  78.          return stage.stageHeight;
  79.       }
  80.       
  81.       public function updateStylesForLocale() : void
  82.       {
  83.          var _loc1_:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Application");
  84.          var _loc2_:CSSStyleDeclaration = StyleManager.getStyleDeclaration("Button");
  85.          var _loc3_:CSSStyleDeclaration = StyleManager.getStyleDeclaration("CheckBox");
  86.          var _loc4_:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".h1");
  87.          var _loc5_:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".h2");
  88.          var _loc6_:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".formItemText");
  89.          this.applyToDeclaration(_loc1_,"Application-",["fontFamily","fontSize"]);
  90.          this.applyToDeclaration(_loc2_,"Button-",["fontFamily","fontSize","fontWeight","paddingTop","paddingBottom","paddingLeft","paddingRight"]);
  91.          this.applyToDeclaration(_loc3_,"CheckBox-",["fontFamily","fontSize","fontWeight"]);
  92.          this.applyToDeclaration(_loc4_,"h1-",["fontFamily","fontSize","fontWeight","leading"]);
  93.          this.applyToDeclaration(_loc5_,"h2-",["fontFamily","fontSize","fontWeight","leading"]);
  94.          this.applyToDeclaration(_loc6_,"formItemText-",["fontWeight"]);
  95.       }
  96.       
  97.       [Bindable(event="propertyChange")]
  98.       public function set stageHeight(param1:Number) : void
  99.       {
  100.          var _loc2_:Object = this.stageHeight;
  101.          if(_loc2_ !== param1)
  102.          {
  103.             this._318928443stageHeight = param1;
  104.             this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"stageHeight",_loc2_,param1));
  105.          }
  106.       }
  107.       
  108.       protected function set locManager(param1:LocalizationManager) : void
  109.       {
  110.          var _loc2_:Object = this._431873101locManager;
  111.          if(_loc2_ !== param1)
  112.          {
  113.             this._431873101locManager = param1;
  114.             this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"locManager",_loc2_,param1));
  115.          }
  116.       }
  117.       
  118.       private function set _318928443stageHeight(param1:Number) : void
  119.       {
  120.          stage.stageHeight = param1;
  121.       }
  122.       
  123.       [Bindable(event="propertyChange")]
  124.       protected function get locManager() : LocalizationManager
  125.       {
  126.          return this._431873101locManager;
  127.       }
  128.    }
  129. }
  130.